package controller;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import java.awt.FlowLayout;
import javax.swing.JList;

import view.RestaurantView;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.Font;
import javax.swing.SwingConstants;


public class test extends JFrame {

	private JPanel contentPane;
	private final Action action = new SwingAction();
	private JTextField textField;
	
	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					test frame = new test();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}*/

	/**
	 * Create the frame.
	 */
	public test() {
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 418, 319);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnFichier = new JMenu("Fichier");
		menuBar.add(mnFichier);
		
		JMenuItem mntmQuitter = new JMenuItem("Quitter");
		mntmQuitter.setAction(action);
		mnFichier.add(mntmQuitter);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(10, 10, 120, 220);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JList list = new JList();
		list.setBounds(0, 0, 120, 220);
		panel.add(list);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBounds(140, 10, 120, 220);
		contentPane.add(panel_1);
		panel_1.setLayout(null);
		
		JList list_1 = new JList();
		list_1.setBounds(0, 0, 120, 180);
		panel_1.add(list_1);
		
		JButton btnAjouter = new JButton("Ajouter");
		btnAjouter.setBounds(0, 191, 76, 23);
		panel_1.add(btnAjouter);
		
		textField = new JTextField();
		textField.setHorizontalAlignment(SwingConstants.CENTER);
		textField.setFont(new Font("Tahoma", Font.PLAIN, 11));
		textField.setText("1");
		textField.setBounds(86, 192, 24, 20);
		panel_1.add(textField);
		textField.setColumns(10);
		
		JPanel panel_3 = new JPanel();
		panel_3.setLayout(null);
		panel_3.setBounds(270, 10, 120, 220);
		contentPane.add(panel_3);
		
		JList list_2 = new JList();
		list_2.setBounds(0, 0, 120, 181);
		panel_3.add(list_2);
		
		JButton btnRetirer = new JButton("Retirer");
		btnRetirer.setBounds(22, 192, 76, 23);
		panel_3.add(btnRetirer);
		
		JButton btnTerminer = new JButton("Terminer la commande");
		btnTerminer.setBounds(125, 241, 149, 23);
		contentPane.add(btnTerminer);
	}

	private class SwingAction extends AbstractAction {
		public SwingAction() {
			putValue(NAME, "Quitter");
		}
		public void actionPerformed(ActionEvent e) {
			System.exit(0);
		}
	}
}
